Left Termination of the query pattern palindrome_in_1(g) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

palindrome(L) :- ','(halves(L, X1s, X2s, EvenOdd), ','(eq(EvenOdd, even), eq(X1s, X2s))).
palindrome(L) :- ','(halves(L, X1s, X2s, EvenOdd), ','(eq(EvenOdd, odd), last(X1s, X, X2s))).
halves([], [], [], even).
halves(.(X, []), .(X, []), [], odd).
halves(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) :- ','(last(.(Y, Xs), R, Rests), halves(Rests, Ts, Rs, EvenOdd)).
last(.(T, []), T, []).
last(.(H, T), X, .(H, M)) :- last(T, X, M).
eq(X, X).

Queries:

palindrome(g).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

palindrome_in(L) → U1(L, halves_in(L, X1s, X2s, EvenOdd))
halves_in(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
halves_in(.(X, []), .(X, []), [], odd) → halves_out(.(X, []), .(X, []), [], odd)
halves_in([], [], [], even) → halves_out([], [], [], even)
U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_out(Rests, Ts, Rs, EvenOdd)) → halves_out(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U4(L, X1s, X2s, eq_in(EvenOdd, odd))
eq_in(X, X) → eq_out(X, X)
U4(L, X1s, X2s, eq_out(EvenOdd, odd)) → U5(L, last_in(X1s, X, X2s))
U5(L, last_out(X1s, X, X2s)) → palindrome_out(L)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U2(L, X1s, X2s, eq_in(EvenOdd, even))
U2(L, X1s, X2s, eq_out(EvenOdd, even)) → U3(L, eq_in(X1s, X2s))
U3(L, eq_out(X1s, X2s)) → palindrome_out(L)

The argument filtering Pi contains the following mapping:
palindrome_in(x1)  =  palindrome_in(x1)
U1(x1, x2)  =  U1(x2)
halves_in(x1, x2, x3, x4)  =  halves_in(x1)
.(x1, x2)  =  .(x1, x2)
U6(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6(x1, x8)
last_in(x1, x2, x3)  =  last_in(x1)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x5)
[]  =  []
last_out(x1, x2, x3)  =  last_out(x2, x3)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x5, x8)
odd  =  odd
halves_out(x1, x2, x3, x4)  =  halves_out(x2, x3, x4)
even  =  even
U4(x1, x2, x3, x4)  =  U4(x2, x4)
eq_in(x1, x2)  =  eq_in(x1, x2)
eq_out(x1, x2)  =  eq_out
U5(x1, x2)  =  U5(x2)
palindrome_out(x1)  =  palindrome_out
U2(x1, x2, x3, x4)  =  U2(x2, x3, x4)
U3(x1, x2)  =  U3(x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

palindrome_in(L) → U1(L, halves_in(L, X1s, X2s, EvenOdd))
halves_in(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
halves_in(.(X, []), .(X, []), [], odd) → halves_out(.(X, []), .(X, []), [], odd)
halves_in([], [], [], even) → halves_out([], [], [], even)
U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_out(Rests, Ts, Rs, EvenOdd)) → halves_out(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U4(L, X1s, X2s, eq_in(EvenOdd, odd))
eq_in(X, X) → eq_out(X, X)
U4(L, X1s, X2s, eq_out(EvenOdd, odd)) → U5(L, last_in(X1s, X, X2s))
U5(L, last_out(X1s, X, X2s)) → palindrome_out(L)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U2(L, X1s, X2s, eq_in(EvenOdd, even))
U2(L, X1s, X2s, eq_out(EvenOdd, even)) → U3(L, eq_in(X1s, X2s))
U3(L, eq_out(X1s, X2s)) → palindrome_out(L)

The argument filtering Pi contains the following mapping:
palindrome_in(x1)  =  palindrome_in(x1)
U1(x1, x2)  =  U1(x2)
halves_in(x1, x2, x3, x4)  =  halves_in(x1)
.(x1, x2)  =  .(x1, x2)
U6(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6(x1, x8)
last_in(x1, x2, x3)  =  last_in(x1)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x5)
[]  =  []
last_out(x1, x2, x3)  =  last_out(x2, x3)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x5, x8)
odd  =  odd
halves_out(x1, x2, x3, x4)  =  halves_out(x2, x3, x4)
even  =  even
U4(x1, x2, x3, x4)  =  U4(x2, x4)
eq_in(x1, x2)  =  eq_in(x1, x2)
eq_out(x1, x2)  =  eq_out
U5(x1, x2)  =  U5(x2)
palindrome_out(x1)  =  palindrome_out
U2(x1, x2, x3, x4)  =  U2(x2, x3, x4)
U3(x1, x2)  =  U3(x2)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

PALINDROME_IN(L) → U11(L, halves_in(L, X1s, X2s, EvenOdd))
PALINDROME_IN(L) → HALVES_IN(L, X1s, X2s, EvenOdd)
HALVES_IN(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
HALVES_IN(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → LAST_IN(.(Y, Xs), R, Rests)
LAST_IN(.(H, T), X, .(H, M)) → U81(H, T, X, M, last_in(T, X, M))
LAST_IN(.(H, T), X, .(H, M)) → LAST_IN(T, X, M)
U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U71(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → HALVES_IN(Rests, Ts, Rs, EvenOdd)
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → U41(L, X1s, X2s, eq_in(EvenOdd, odd))
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → EQ_IN(EvenOdd, odd)
U41(L, X1s, X2s, eq_out(EvenOdd, odd)) → U51(L, last_in(X1s, X, X2s))
U41(L, X1s, X2s, eq_out(EvenOdd, odd)) → LAST_IN(X1s, X, X2s)
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → U21(L, X1s, X2s, eq_in(EvenOdd, even))
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → EQ_IN(EvenOdd, even)
U21(L, X1s, X2s, eq_out(EvenOdd, even)) → U31(L, eq_in(X1s, X2s))
U21(L, X1s, X2s, eq_out(EvenOdd, even)) → EQ_IN(X1s, X2s)

The TRS R consists of the following rules:

palindrome_in(L) → U1(L, halves_in(L, X1s, X2s, EvenOdd))
halves_in(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
halves_in(.(X, []), .(X, []), [], odd) → halves_out(.(X, []), .(X, []), [], odd)
halves_in([], [], [], even) → halves_out([], [], [], even)
U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_out(Rests, Ts, Rs, EvenOdd)) → halves_out(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U4(L, X1s, X2s, eq_in(EvenOdd, odd))
eq_in(X, X) → eq_out(X, X)
U4(L, X1s, X2s, eq_out(EvenOdd, odd)) → U5(L, last_in(X1s, X, X2s))
U5(L, last_out(X1s, X, X2s)) → palindrome_out(L)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U2(L, X1s, X2s, eq_in(EvenOdd, even))
U2(L, X1s, X2s, eq_out(EvenOdd, even)) → U3(L, eq_in(X1s, X2s))
U3(L, eq_out(X1s, X2s)) → palindrome_out(L)

The argument filtering Pi contains the following mapping:
palindrome_in(x1)  =  palindrome_in(x1)
U1(x1, x2)  =  U1(x2)
halves_in(x1, x2, x3, x4)  =  halves_in(x1)
.(x1, x2)  =  .(x1, x2)
U6(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6(x1, x8)
last_in(x1, x2, x3)  =  last_in(x1)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x5)
[]  =  []
last_out(x1, x2, x3)  =  last_out(x2, x3)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x5, x8)
odd  =  odd
halves_out(x1, x2, x3, x4)  =  halves_out(x2, x3, x4)
even  =  even
U4(x1, x2, x3, x4)  =  U4(x2, x4)
eq_in(x1, x2)  =  eq_in(x1, x2)
eq_out(x1, x2)  =  eq_out
U5(x1, x2)  =  U5(x2)
palindrome_out(x1)  =  palindrome_out
U2(x1, x2, x3, x4)  =  U2(x2, x3, x4)
U3(x1, x2)  =  U3(x2)
U51(x1, x2)  =  U51(x2)
HALVES_IN(x1, x2, x3, x4)  =  HALVES_IN(x1)
LAST_IN(x1, x2, x3)  =  LAST_IN(x1)
U41(x1, x2, x3, x4)  =  U41(x2, x4)
U71(x1, x2, x3, x4, x5, x6, x7, x8)  =  U71(x1, x5, x8)
U61(x1, x2, x3, x4, x5, x6, x7, x8)  =  U61(x1, x8)
U11(x1, x2)  =  U11(x2)
U31(x1, x2)  =  U31(x2)
U21(x1, x2, x3, x4)  =  U21(x2, x3, x4)
U81(x1, x2, x3, x4, x5)  =  U81(x1, x5)
PALINDROME_IN(x1)  =  PALINDROME_IN(x1)
EQ_IN(x1, x2)  =  EQ_IN(x1, x2)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

PALINDROME_IN(L) → U11(L, halves_in(L, X1s, X2s, EvenOdd))
PALINDROME_IN(L) → HALVES_IN(L, X1s, X2s, EvenOdd)
HALVES_IN(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
HALVES_IN(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → LAST_IN(.(Y, Xs), R, Rests)
LAST_IN(.(H, T), X, .(H, M)) → U81(H, T, X, M, last_in(T, X, M))
LAST_IN(.(H, T), X, .(H, M)) → LAST_IN(T, X, M)
U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U71(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → HALVES_IN(Rests, Ts, Rs, EvenOdd)
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → U41(L, X1s, X2s, eq_in(EvenOdd, odd))
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → EQ_IN(EvenOdd, odd)
U41(L, X1s, X2s, eq_out(EvenOdd, odd)) → U51(L, last_in(X1s, X, X2s))
U41(L, X1s, X2s, eq_out(EvenOdd, odd)) → LAST_IN(X1s, X, X2s)
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → U21(L, X1s, X2s, eq_in(EvenOdd, even))
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → EQ_IN(EvenOdd, even)
U21(L, X1s, X2s, eq_out(EvenOdd, even)) → U31(L, eq_in(X1s, X2s))
U21(L, X1s, X2s, eq_out(EvenOdd, even)) → EQ_IN(X1s, X2s)

The TRS R consists of the following rules:

palindrome_in(L) → U1(L, halves_in(L, X1s, X2s, EvenOdd))
halves_in(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
halves_in(.(X, []), .(X, []), [], odd) → halves_out(.(X, []), .(X, []), [], odd)
halves_in([], [], [], even) → halves_out([], [], [], even)
U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_out(Rests, Ts, Rs, EvenOdd)) → halves_out(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U4(L, X1s, X2s, eq_in(EvenOdd, odd))
eq_in(X, X) → eq_out(X, X)
U4(L, X1s, X2s, eq_out(EvenOdd, odd)) → U5(L, last_in(X1s, X, X2s))
U5(L, last_out(X1s, X, X2s)) → palindrome_out(L)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U2(L, X1s, X2s, eq_in(EvenOdd, even))
U2(L, X1s, X2s, eq_out(EvenOdd, even)) → U3(L, eq_in(X1s, X2s))
U3(L, eq_out(X1s, X2s)) → palindrome_out(L)

The argument filtering Pi contains the following mapping:
palindrome_in(x1)  =  palindrome_in(x1)
U1(x1, x2)  =  U1(x2)
halves_in(x1, x2, x3, x4)  =  halves_in(x1)
.(x1, x2)  =  .(x1, x2)
U6(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6(x1, x8)
last_in(x1, x2, x3)  =  last_in(x1)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x5)
[]  =  []
last_out(x1, x2, x3)  =  last_out(x2, x3)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x5, x8)
odd  =  odd
halves_out(x1, x2, x3, x4)  =  halves_out(x2, x3, x4)
even  =  even
U4(x1, x2, x3, x4)  =  U4(x2, x4)
eq_in(x1, x2)  =  eq_in(x1, x2)
eq_out(x1, x2)  =  eq_out
U5(x1, x2)  =  U5(x2)
palindrome_out(x1)  =  palindrome_out
U2(x1, x2, x3, x4)  =  U2(x2, x3, x4)
U3(x1, x2)  =  U3(x2)
U51(x1, x2)  =  U51(x2)
HALVES_IN(x1, x2, x3, x4)  =  HALVES_IN(x1)
LAST_IN(x1, x2, x3)  =  LAST_IN(x1)
U41(x1, x2, x3, x4)  =  U41(x2, x4)
U71(x1, x2, x3, x4, x5, x6, x7, x8)  =  U71(x1, x5, x8)
U61(x1, x2, x3, x4, x5, x6, x7, x8)  =  U61(x1, x8)
U11(x1, x2)  =  U11(x2)
U31(x1, x2)  =  U31(x2)
U21(x1, x2, x3, x4)  =  U21(x2, x3, x4)
U81(x1, x2, x3, x4, x5)  =  U81(x1, x5)
PALINDROME_IN(x1)  =  PALINDROME_IN(x1)
EQ_IN(x1, x2)  =  EQ_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 13 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LAST_IN(.(H, T), X, .(H, M)) → LAST_IN(T, X, M)

The TRS R consists of the following rules:

palindrome_in(L) → U1(L, halves_in(L, X1s, X2s, EvenOdd))
halves_in(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
halves_in(.(X, []), .(X, []), [], odd) → halves_out(.(X, []), .(X, []), [], odd)
halves_in([], [], [], even) → halves_out([], [], [], even)
U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_out(Rests, Ts, Rs, EvenOdd)) → halves_out(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U4(L, X1s, X2s, eq_in(EvenOdd, odd))
eq_in(X, X) → eq_out(X, X)
U4(L, X1s, X2s, eq_out(EvenOdd, odd)) → U5(L, last_in(X1s, X, X2s))
U5(L, last_out(X1s, X, X2s)) → palindrome_out(L)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U2(L, X1s, X2s, eq_in(EvenOdd, even))
U2(L, X1s, X2s, eq_out(EvenOdd, even)) → U3(L, eq_in(X1s, X2s))
U3(L, eq_out(X1s, X2s)) → palindrome_out(L)

The argument filtering Pi contains the following mapping:
palindrome_in(x1)  =  palindrome_in(x1)
U1(x1, x2)  =  U1(x2)
halves_in(x1, x2, x3, x4)  =  halves_in(x1)
.(x1, x2)  =  .(x1, x2)
U6(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6(x1, x8)
last_in(x1, x2, x3)  =  last_in(x1)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x5)
[]  =  []
last_out(x1, x2, x3)  =  last_out(x2, x3)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x5, x8)
odd  =  odd
halves_out(x1, x2, x3, x4)  =  halves_out(x2, x3, x4)
even  =  even
U4(x1, x2, x3, x4)  =  U4(x2, x4)
eq_in(x1, x2)  =  eq_in(x1, x2)
eq_out(x1, x2)  =  eq_out
U5(x1, x2)  =  U5(x2)
palindrome_out(x1)  =  palindrome_out
U2(x1, x2, x3, x4)  =  U2(x2, x3, x4)
U3(x1, x2)  =  U3(x2)
LAST_IN(x1, x2, x3)  =  LAST_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LAST_IN(.(H, T), X, .(H, M)) → LAST_IN(T, X, M)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
LAST_IN(x1, x2, x3)  =  LAST_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

LAST_IN(.(H, T)) → LAST_IN(T)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

HALVES_IN(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → HALVES_IN(Rests, Ts, Rs, EvenOdd)

The TRS R consists of the following rules:

palindrome_in(L) → U1(L, halves_in(L, X1s, X2s, EvenOdd))
halves_in(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
halves_in(.(X, []), .(X, []), [], odd) → halves_out(.(X, []), .(X, []), [], odd)
halves_in([], [], [], even) → halves_out([], [], [], even)
U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_out(Rests, Ts, Rs, EvenOdd)) → halves_out(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U4(L, X1s, X2s, eq_in(EvenOdd, odd))
eq_in(X, X) → eq_out(X, X)
U4(L, X1s, X2s, eq_out(EvenOdd, odd)) → U5(L, last_in(X1s, X, X2s))
U5(L, last_out(X1s, X, X2s)) → palindrome_out(L)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U2(L, X1s, X2s, eq_in(EvenOdd, even))
U2(L, X1s, X2s, eq_out(EvenOdd, even)) → U3(L, eq_in(X1s, X2s))
U3(L, eq_out(X1s, X2s)) → palindrome_out(L)

The argument filtering Pi contains the following mapping:
palindrome_in(x1)  =  palindrome_in(x1)
U1(x1, x2)  =  U1(x2)
halves_in(x1, x2, x3, x4)  =  halves_in(x1)
.(x1, x2)  =  .(x1, x2)
U6(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6(x1, x8)
last_in(x1, x2, x3)  =  last_in(x1)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x5)
[]  =  []
last_out(x1, x2, x3)  =  last_out(x2, x3)
U7(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7(x1, x5, x8)
odd  =  odd
halves_out(x1, x2, x3, x4)  =  halves_out(x2, x3, x4)
even  =  even
U4(x1, x2, x3, x4)  =  U4(x2, x4)
eq_in(x1, x2)  =  eq_in(x1, x2)
eq_out(x1, x2)  =  eq_out
U5(x1, x2)  =  U5(x2)
palindrome_out(x1)  =  palindrome_out
U2(x1, x2, x3, x4)  =  U2(x2, x3, x4)
U3(x1, x2)  =  U3(x2)
HALVES_IN(x1, x2, x3, x4)  =  HALVES_IN(x1)
U61(x1, x2, x3, x4, x5, x6, x7, x8)  =  U61(x1, x8)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

HALVES_IN(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → HALVES_IN(Rests, Ts, Rs, EvenOdd)

The TRS R consists of the following rules:

last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
last_in(x1, x2, x3)  =  last_in(x1)
U8(x1, x2, x3, x4, x5)  =  U8(x1, x5)
[]  =  []
last_out(x1, x2, x3)  =  last_out(x2, x3)
HALVES_IN(x1, x2, x3, x4)  =  HALVES_IN(x1)
U61(x1, x2, x3, x4, x5, x6, x7, x8)  =  U61(x1, x8)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ RuleRemovalProof

Q DP problem:
The TRS P consists of the following rules:

HALVES_IN(.(T, .(Y, Xs))) → U61(T, last_in(.(Y, Xs)))
U61(T, last_out(R, Rests)) → HALVES_IN(Rests)

The TRS R consists of the following rules:

last_in(.(H, T)) → U8(H, last_in(T))
last_in(.(T, [])) → last_out(T, [])
U8(H, last_out(X, M)) → last_out(X, .(H, M))

The set Q consists of the following terms:

last_in(x0)
U8(x0, x1)

We have to consider all (P,Q,R)-chains.
By using the rule removal processor [15] with the following polynomial ordering [25], at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

HALVES_IN(.(T, .(Y, Xs))) → U61(T, last_in(.(Y, Xs)))
U61(T, last_out(R, Rests)) → HALVES_IN(Rests)

Strictly oriented rules of the TRS R:

last_in(.(H, T)) → U8(H, last_in(T))
last_in(.(T, [])) → last_out(T, [])
U8(H, last_out(X, M)) → last_out(X, .(H, M))

Used ordering: POLO with Polynomial interpretation [25]:

POL(.(x1, x2)) = 2 + 2·x1 + 2·x2   
POL(HALVES_IN(x1)) = 1 + 2·x1   
POL(U61(x1, x2)) = 2 + 2·x1 + 2·x2   
POL(U8(x1, x2)) = 1 + 2·x1 + 2·x2   
POL([]) = 1   
POL(last_in(x1)) = 2·x1   
POL(last_out(x1, x2)) = 2 + 2·x1 + x2   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
QDP
                            ↳ PisEmptyProof

Q DP problem:
P is empty.
R is empty.
The set Q consists of the following terms:

last_in(x0)
U8(x0, x1)

We have to consider all (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.